perm filename FLOYD.A[1,PHY] blob
sn#345282 filedate 1978-03-27 generic text, type C, neo UTF8
COMMENT ā VALID 00003 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 %File Protection%.
C00005 00003 APPENDIX
C00009 ENDMK
Cā;
%File Protection%.
Unless you take some action to protect your files, they can be read or
copied by anyone. This is inapprorpriate for course assignments, in a world
where not everyone is honest. To change the protection status of a file,
use the TOPS-20 command
@ SET FILE PROTECTION filename n
where n is a six digit number, say AABBCC . Here the two digits AA
control what you yourself can do to the file, BB should be 00 for most
student work, and CC controls what everyone else can do to your program.
Each of these two digit numbers is obtained by adding up codes for the
capabilities you want to allow, according to this code:
40 Allow reading.
20 Allow writing (i.e., changing the file, possibly losing its
current contents).
10 Allow executing.
04 Allow appending to the file.
02 Allow appearance in directory listings.
01 Has no effect.
If you don't protect a file, it has protection number 777752 , (contrary
to what the manual says), so anyone can read or execute it or see that it is
in your directory; only you can change or add to it. A more appropriate
protection number for homework SAIL programs is 770002 .
You may at times want to protect your files even from yourself, to prevent
unintentional erasing.
You can set the protection for all files you create in the future by
the TOPS-20 command
SET DIRECTORY FILE-PROTECTION-DEFAULT <your user name> n
where n is again the protection number. This command does not affect present
or future generations of existing files. It does not prevent you from changing
the protection numbers on individual files after creating them.
For more details, see DEC System-20 Overview, D5-3 to D5-4 and D4-7 to
D4-8.
APPENDIX
Program Execution Profiles.
The following program has been provided with an execution profile, showing
how many times each command was executed.
Such profiles show up many program bugs. Especially obvious are commands
executed zero times, often because of errors in conditions following IF and
WHILE, and iterations where the body is only executed once for each time the
iteration is entered, often because the body of the iteration changes the
iteration variable.
To get such a profile, for a program called, say, MYPROG.SAI, first execute
the program using the TOPS-20 command
@ EXECUTE MYPROG.SAI/PROFILE RETURN
and wait for normal compilation and execution. After you see
End of SAIL execution
on the screen, give the TOPS-20 command
@ PROFIL RETURN
(Note spelling!)
The profile program will prompt with an asterisk for the name of the file
(say MYPROG.PRO) where the profile listing is to go, an underline, and the
name of the SAIL program you executed; for example:
* MYPROG.PRO-MYPROG/T RETURN
where the /T is a useful option requiring a listing format that can be
displayed on the terminal screen without wrapping around. Now you can get
a hard copy of the profile by
@ PRINT MYPROG.PRO RETURN
or
@ LIST MYPROG.PRO RETURN
, or you can see it on the screen by
@ TYPE MYPROG.PRO RETURN
The profile program creates three new fils; one is the one you named after the
asterisk, the other two have the same name of your program, with types .LST
and .KNT , in this case MYPROG.LST and MYPROG.KNT; you will probably want to
delete at least the .LST and .KNT files.
Your profile listing will not look exactly like your original program.
Definitions and source files are filled in wherever they have been used, and
a standard legible indentation format is used.
For more information, see
@ HELP PROFIL RETURN